<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li><a ui-sref="main.finance.accountRec.list">应收款明细</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 内容区域 -->
<div class="wrapper-md content">
    <div class="panel panel-default">
        <!-- 头部 -->
        <div class="panel-heading font-bold">
            <a class="btn btn-sm btn-icon btn-rounded btn-default pull-right m-t-n-xs"
               ui-sref="main.finance.accountRec.list"></a>
        </div>

        <!--表单-->
        <div class="panel-body">
            <form class="form-horizontal" name="user_form">
                <!--广告主-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">广告主:</label>
                    <label class="control-label">{{record.companyName}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!--充值方式-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">充值方式:</label>
                    <label class="control-label">{{record.rechargeType=='0'?'线上':'线下'}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <!--充值金额-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">充值金额:</label>
                    <label class="control-label">{{record.amount}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <!--收款类型-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">收款类型:</label>
                    <label class="control-label" ng-if="record.accountType=='1'">支付宝</label>
                    <label class="control-label" ng-if="record.accountType=='2'">财付通</label>
                    <label class="control-label" ng-if="record.accountType=='3'">银行卡</label>
                    <label class="control-label" ng-if="record.accountType=='4'">现金</label>
                    <label class="control-label" ng-if="record.accountType=='5'">返现</label>
                    <label class="control-label" ng-if="record.accountType=='6'">冲销</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <!--付款账户-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">付款账户:</label>
                    <label class="control-label">{{record.cardNumber}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div ng-show="record.accountType=='3'">
                    <!--行别-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label">开户行:</label>
                        <label class="control-label">{{record.bankName}}</label>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!--汇款单位/个人-->

                        <label class="col-lg-2 col-sm-3 control-label">汇款单位/个人:</label>

                        <label class="control-label">{{record.info}}</label>
                    </div>
                <!--  <div ng-show="record.receAcctType=='01'">
                      &lt;!&ndash;支付宝账号&ndash;&gt;
                      <div class="form-group">
                          <label class="col-lg-2 col-sm-3 control-label">支付宝账号:</label>
                          <label class="control-label">{{record.alipay}}</label>
                      </div>
                      <div class="line line-dashed b-b line-lg pull-in"></div>

                      &lt;!&ndash;支付宝用户名&ndash;&gt;
                      <div class="form-group">
                          <label class="col-lg-2 col-sm-3 control-label">支付宝用户名:</label>
                          <label class="control-label">{{record.alipayName}}</label>
                      </div>
                      <div class="line line-dashed b-b line-lg pull-in"></div>
                  </div>-->
                <div ng-if="record.rechargeStatus=='2'||record.rechargeStatus=='5'">
                <!--交易流水号-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">交易流水号:</label>
                    <label class="control-label">{{record.orderId}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <!--交易日期-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">交易日期:</label>
                    <label class="control-label">{{record.tradeDate | date:'yyyy-MM-dd' |limitTo:19}}</label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                </div>

                <!--交易状态-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label">交易状态:</label>
                    <label class="control-label" ng-if="record.rechargeStatus=='1'">待审核</label>
                    <label class="control-label" ng-if="record.rechargeStatus=='2'">审核完成</label>
                    <label class="control-label" ng-if="record.rechargeStatus=='3'">审核失败</label>
                    <label class="control-label" ng-if="record.rechargeStatus=='4'">取消</label>
                    <label class="control-label" ng-if="record.rechargeStatus=='5'">付款完成</label>
                </div>

                <div ng-if="record.accountType=='6'">
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!--冲销原因-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label">冲销原因:</label>
                        <label class="control-label">{{record.tradeRemark}}</label>
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label pull-right">
                        <a ui-sref="main.finance.accountRec.list">
                            <button class="btn btn-default w-xs">返回</button>
                        </a>
                    </label>
                    <label class="col-sm-1 control-label pull-right"
                           ng-if="record.rechargeStatus==2 && record.iden=='2'"
                           has-permission permission='finance.accountRec.update'>
                        <button class="btn btn-success w-xs" ng-click="approve(record.id,5)">提&nbsp;&nbsp;交</button>
                    </label>
                    <label class="col-sm-1 control-label pull-right"
                           ng-if="record.rechargeStatus==1 && record.iden=='2'"
                           has-permission permission='finance.accountRec.update'>
                        <button class="btn btn-success w-xs" ng-click="approve(record.id,4)">取&nbsp;&nbsp;消</button>
                    </label>
                    <label class="col-sm-1 control-label pull-right"
                           ng-if="record.rechargeStatus==1 && record.iden=='2'"
                           has-permission permission='finance.accountRec.update'>
                        <button class="btn btn-danger" ng-click="preview()">审核失败</button>
                    </label>
                    <label class="col-sm-1 control-label pull-right"
                           ng-if="record.rechargeStatus==1 && record.iden=='2'"
                           has-permission permission='finance.accountRec.update'>
                        <button class="btn btn-success" ng-click="approve(record.id,2)">审核通过</button>
                    </label>
                </div>

                <div class="cover" ng-show="firstApply">
                    <div class="firstApplyWrap">
                        <div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply=false">
                            &#xe608;</i></div>
                        <div class="title"><textarea placeholder="请输入审核失败的原因......" class="form-control" rows="5"
                                                     id="remark"></textarea>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" ng-click="firstApply=false"
                                        data-dismiss="modal">取消
                                </button>
                                <button type="button" class="btn btn-primary" ng-click="approveFail(record.id,3)">确定
                                </button>
                            </div>
                        </div>

                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<form id="saveRefuse">
    <div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="refusePlatfrom" role="dialog" aria-labelledby="gridSystemModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="gridSystemModalLabel">平台审核</h4>
                </div>
                <div class="modal-body">
                    <p></p>
                    <div class="row">
                        <label class="col-sm-2 control-label text-right">交易流水号:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="approveFailReason"  id="bankTradeNo" maxlength="60" placeholder="请输入交易流水号" onkeyup="if(!/^\d+$/.test(this.value)) { this.value='';}">
                        </div>
                    </div>
                    <p></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="approve(record.id,2)">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</form>


<form id="backCashModalfrom">
    <div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="backCashModal" role="dialog" aria-labelledby="backCashModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="backCashModalLabel">冲销</h4>
                </div>
                <div class="modal-body">
                    <p></p>
                    <div class="row">
                        <label class="col-sm-2 control-label text-right">交易流水号:</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control require" name="backTradNO" data-title="交易流水号" id="backTradNO" maxlength="60" placeholder="请输入交易流水号" onkeyup="if(!/^\d+$/.test(this.value)) { this.value='';}">
                        </div>
                    </div>
                    <p></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" ng-click="backTradApprove(record.id,5)">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</form>
<style>
    .cover {
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2000;
        top: 0;
        left: 0;
        /* display: none; */
    }

    .firstApplyWrap {
        width: 550px;
        height: 280px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        -webkit-transform: translate(-50%, -50%);
        -ms-transform: translate(-50%, -50%);
        -o-transform: translate(-50%, -50%);
        -moz-transform: translate(-50%, -50%);
        border-radius: 5px;
        overflow: hidden;
    }

    .firstApplyWrap .title {
        font-size: 18px;
        color: #333;
        padding: 18px 36px 0 36px;
        text-align: center;
        line-height: 2em;
    }

    .firstApplyWrap .closeBtn, .finishData .closeBtn {
        font-size: 30px;
        padding: 5px 10px 0 0;
        border-radius: 50%;
        color: #ccc;
        float: right;
        cursor: pointer;
    }

    .finishData .closeBtn {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .firstApplyWrap .bkgIcon {
        position: absolute;
        left: 54px;
        top: 87px;
        font-size: 50px;
        color: #FFB136;
    }

    .firstApplyWrap .applyBtnWrap {
        position: absolute;
        bottom: -2px;
        width: 100%;
    }

    .firstApplyWrap .applyBtn {
        width: 50%;
        height: 70px;
        line-height: 70px;
        background: #FFB135;
        font-size: 20px;
        text-align: center;
        color: #fff;
        cursor: pointer;
        float: left;
    }

    .firstApplyWrap .applyBtn:last-child {
        background: #5796FC;
    }
</style>
